package kr.co.doriclassic.powerjava.chapter21;

import java.util.InputMismatchException;
import java.util.Scanner;

public class DevideByZero {
	public static void main(String[] args) {
		int x = 0;
		int y = 0;
		int result = 0;

		Scanner sc = new Scanner(System.in);
		
		try{
			System.out.print("피젯수:");
			x= sc.nextInt();
			System.out.print("젯수:");
			y= sc.nextInt();
			result = x/y;	

		}
		catch(InputMismatchException e){
			System.out.println("숫자만 가능합니다.");
		} catch (ArithmeticException e) {
			System.out.println("0으로 나눌 수 없습니다.");
		} 	
		catch (Exception e) {
		}
		finally{
			System.out.println("나눗셈 결과:"+result);
		}
	}
}
